
$(document).ready(function() {
	
	/* 兑换飞币 */
	$(".dh-fb-bt").click(function(e) {
		var feibi = 0;	//账户飞币
		try {
			feibi = parseInt($.parseJSON($.cookie('User')).feibi);
		} catch(e) {
			console.log(e);
		}
		var fbnum = $(".dh-fb-num").val();		
		if(fbnum > feibi) {
			Utils.msgDialog("账户飞币不足，赶紧去赚吧！");
			return;
		}
		
		var param = {
			feibi: fbnum,
		};
        AQ.callAQ("feibiToMoney.do", param, function(result) {
			Utils.msgDialog("兑换成功");
			Utils.refreshUserInfo();	//刷新用户信息
		}, function(err, code) {
			Utils.msgDialog(err + "["+ code +"]");
		});
    });
	
});